import Vue from 'vue';
import VueRouter from 'vue-router';
// 注册VueRouter
Vue.use(VueRouter);

// 创建页面路由注册，路由 一个页面多个接口的创建
const routes=[
    {
        path:'/login',
        component: () => import("../views/login.vue"),
    },
    {
        path:'/',
        component: () => import("../views/index.vue"),
    },
    {
        path:'/register',
        component: () => import("../views/register.vue"),
    },
    {
        path:'/personalCenter',
        component: () => import("../views/personalCenter.vue"),
    },
    {
        path:'/editProfile',
        component: () => import("../views/editProfile.vue"),
    },
    {
        path:'/search',
        component: () => import("../views/search.vue"),
    },
    {
        path: "/articleDetail/:id",
        component: () => import("../views/articleDetail.vue"),
    },
    {
        path:"/commentList/:id",
        component:()=>import('../views/commentList.vue')
    },
    {
        path:"/followUser",
        component:()=>import('../views/followUser.vue')
    },
    {
        path:"/myCollect",
        component:()=>import('../views/myCollect.vue')
    },
]

// 创建路由实例
const route = new VueRouter({
    routes,
});

// 导出路由模块给main.js使用
export default route;